﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using ViCode_LeVi.Data;
using ViCode_LeVi.Controls.Charts;
using ViCode_LeVi.Controls.Logs;

namespace ViCode_LeVi.Controls.Reports
{
    public partial class PotentialPortfolioChartSubReport : XtraReport
    {
        private string m_sInterpretation = string.Empty;
        public PotentialPortfolioChartSubReport()
        {
            InitializeComponent();
        }
        public bool CreateReport(PotentialPortfolioChart oChartCtrl, ref int riNumberOfElements)
        {
            bool flag = true;
            try
            {
                if (oChartCtrl != null)
                {
                    this.m_oChartCtrl1.ChartLabelMode = oChartCtrl.ChartLabelMode;
                    this.m_oChartCtrl1.LabelWithPercent = oChartCtrl.LabelWithPercent;
                    this.m_oChartCtrl1.ChartLegendMode = oChartCtrl.ChartLegendMode;
                    this.m_oChartCtrl1.LegendWithPercent = oChartCtrl.LegendWithPercent;
                    this.m_oChartCtrl1.FilterFactorTypeBK = oChartCtrl.FilterFactorTypeBK;
                    this.m_oChartCtrl1.FilterFactorTypeHK = oChartCtrl.FilterFactorTypeHK;
                    this.m_oChartCtrl1.FilterFactorTypeSK = oChartCtrl.FilterFactorTypeSK;
                    this.m_oChartCtrl1.XAxisAreaZoom = oChartCtrl.XAxisAreaZoom;
                    this.m_oChartCtrl1.LabelAlignment = oChartCtrl.LabelAlignment;
                    this.m_oChartCtrl1.ChartBackColor = Color.White;
                    this.m_oChartCtrl1.Func_GetStep_TaskItemGroup = oChartCtrl.Func_GetStep_TaskItemGroup;
                }
                this.m_oChartCtrl1.CreateChart();
                riNumberOfElements = this.m_oChartCtrl1.NumberOfElements;
            }
            catch (Exception exception)
            {
                flag = false;
                Log.LogException(exception);
            }
            return flag;
        }
        public string Interpretation
        {
            get
            {
                return this.m_sInterpretation;
            }
            set
            {
                this.m_sInterpretation = value;
                this.cellInterpretation.Text = ReportTemplate.GetInterpretationString(this.m_sInterpretation);
            }
        }
    }
}
